package css.core;

public class Customer {
	
	private int customerID;
	private int customerType;
	// indicate the purchase pattern of the customer
	// 0 = buy packed food
	// 1 = buy food only
	// 2 = buy drink only
	// 3 = buy food and drink
	private int arriveTime;
	private int leaveTime;
	

	
	/** 
	 * The constructor of the Customer class
	 * @param customerID  The ID of current customer
	 * @param customerType  The purchase pattern of the customer
	 * @param startTime  The time when the customer joins the main queue
	 */
	public Customer(int customerID, int customerType, int startTime){
		this.customerID = customerID;
		this.customerType = customerType;
		this.setArriveTime(startTime);
		this.leaveTime = Integer.MAX_VALUE;
	}

	/**
	 * Calculate the service time of the customer
	 * @return  service time of the customer
	 */
	public int getServiceTime(){
		return (this.leaveTime-this.arriveTime);
	}
	
// Getters and setters
	public int getCustomerID() {
		return customerID;
	}

	public void setCustomerID(int customerID) {
		this.customerID = customerID;
	}

	public int getCustomerType() {
		return customerType;
	}

	public void setCustomerType(int customerType) {
		this.customerType = customerType;
	}
	
	public int getArriveTime() {
		return arriveTime;
	}

	public void setArriveTime(int arriveTime) {
		this.arriveTime = arriveTime;
	}

	public int getLeaveTime() {
		return leaveTime;
	}

	public void setLeaveTime(int leaveTime) {
		this.leaveTime = leaveTime;
	}
	
}
